package com.bjpowernode.springboot.service.impl;
import com.bjpowernode.springboot.domain.User;
import com.bjpowernode.springboot.domain.UserVO;
import com.bjpowernode.springboot.mapper.CharacterMapper;
import com.bjpowernode.springboot.service.CharacterService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bjpowernode.springboot.domain.Character;

import java.util.List;

@Service
public  class CharacterServiceImpl implements CharacterService {
    @Autowired
    CharacterMapper characterMapper;

    @Override
    public int deleteByPrimaryKeyCharacter(Integer id) {
        return characterMapper.deleteByPrimaryKeyCharacter(id);
    }

    @Override
    public int insertCharacter(Character record) {
        return characterMapper.insertCharacter(record);
    }

    @Override
    public int insertSelectiveCharacter(Character record) {
        return characterMapper.insertSelectiveCharacter(record);
    }

    @Override
    public Character selectByPrimaryKeyCharacter(Integer id) {
        return characterMapper.selectByPrimaryKeyCharacter(id);
    }

    @Override
    public int updateByPrimaryKeySelectiveCharacter(Character record) {
        return characterMapper.updateByPrimaryKeySelectiveCharacter(record);
    }



    @Override
    public List<Character> selectDaoCharacter(int page, int size) {
        PageHelper.startPage(page, size);
        //使用分页插件，最核心的一句，即开启分页
        List<Character> list = characterMapper.selectDaoCharacter();
        return list;
    }

    @Override
    public List<Character> selectDaoCharacterQ() {
        return characterMapper.selectDaoCharacter();
    }
}
